@extends('layouts.admin-app')

@section('content')

    <div class="contentpanel panel-email">
        <div class="box">
            @include('admin.partials.errors')
            @include('admin.partials.success')
        </div>

        <div class="row">

            <div class="col-sm-9 col-lg-12">

                <div class="panel panel-default">
                    <div class="panel-body">

                        <div class="pull-right">
                            <div class="btn-group mr10">
                                <a href="{{ route('admin.bingqu.create') }}" class="btn btn-white tooltips"
                                   data-toggle="tooltip" data-original-title="新增"><i
                                            class="glyphicon glyphicon-plus"></i></a>
                            </div>
                        </div><!-- pull-right -->

                        <h5 class="subtitle mb5">病区列表</h5>

                        <div class="table-responsive col-md-12">
                            <table class="table mb30">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>名称</th>
                                    <th>负责人</th>
                                    <th>病床数</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $v)
                                    <tr>
                                        <td>{{ $v->id }}</td>
                                        <td>{{ $v->name }}</td>
                                        <td>{{ $v->leader }}</td>
                                        <td>{{ $v->num }}</td>
                                        <td>
                                            <a href="{{ route('admin.bingqu.edit',['id'=>$v->id]) }}" class="btn btn-white btn-xs"><i class="fa fa-pencil"></i> 编辑</a>
                                            {{--<a class="btn btn-danger btn-xs user-delete" data-href="{{ route('admin.bingqu.destroy',['id'=>$v->id]) }}"> <i class="fa fa-trash-o"></i> 删除</a>--}}
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>

                        {!! $data->render() !!}

                    </div><!-- panel-body -->
                </div><!-- panel -->

            </div><!-- col-sm-9 -->

        </div><!-- row -->

    </div>
@endsection

@section('javascript')
    @parent
    <script src="{{ asset('js/ajax.js') }}"></script>
    <script type="text/javascript">
//        $(".user-delete").click(function () {
//            Rbac.ajax.delete({
//                confirmTitle: '确定删除用户?',
//                href: $(this).data('href'),
//                successTitle: '用户删除成功'
//            });
//        });

    </script>

@endsection
